package ai.leinao.alarm;

import cn.hutool.json.JSONUtil;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * description
 *
 * @author zhong.wang
 * @date 2025/10/15
 **/
@Data
public class Condition {
    private String expression;
    private Long alarmLevelId;
    private String alarmLevelName;
    private int alarmLevelNum;

    public static void main(String[] args) {
        Condition condition1 = new Condition();
        condition1.setExpression("x > 40");
        condition1.setAlarmLevelId(1L);
        condition1.setAlarmLevelName("危机");
        condition1.setAlarmLevelNum(1);
        Condition condition2 = new Condition();
        condition2.setExpression("x > 20");
        condition2.setAlarmLevelId(2L);
        condition2.setAlarmLevelName("严重");
        condition2.setAlarmLevelNum(2);
        Condition condition3 = new Condition();
        condition3.setExpression("x > 10");
        condition3.setAlarmLevelId(3L);
        condition3.setAlarmLevelName("一般");
        condition3.setAlarmLevelNum(3);
        Condition condition4 = new Condition();
        List< Condition> conditions = new ArrayList<>();
        conditions.add(condition1);
        conditions.add(condition2);
        conditions.add(condition3);
        System.out.println(JSONUtil.toJsonStr( conditions));
    }
}
